<?php /* Smarty version 2.6.18, created on 2016-12-13 17:02:32
         compiled from mail/mail.add.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "mail/mail.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <!-- /.col -->
	<form name="myform" method="post" action=""  enctype="multipart/form-data">
       <div class="col-md-9">
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">写邮件</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="form-group">
									   <input name="mail_to" id="staff_name" type="text" class="form-control" value="<?php echo $this->_tpl_vars['mail_data']['mail_fromname']; ?>
" autocomplete="off" placeholder="收件人:">
									   <input name="mail_to" id="staff_id" type="hidden" class="form-control" value="<?php echo $this->_tpl_vars['mail_data']['mail_from']; ?>
">
              </div>
              <div class="form-group">
                <input name="mail_title" value="<?php echo $this->_tpl_vars['mail_title']; ?>
" class="form-control" placeholder="主题:">
              </div>
              <div class="form-group">
                     <textarea id="mail_content" name="mail_content" rows="22" cols="40" style="width: 100%"><?php echo $this->_tpl_vars['mail_content']; ?>
</textarea>
              </div>
             </div>
			<?php if ($this->_tpl_vars['mail_data']['mail_file'] != ""): ?>
            <div class="box-footer">
              <ul class="mailbox-attachments clearfix">
				<?php $_from = $this->_tpl_vars['mail_data']['mail_file']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                <li>

                  <div class="mailbox-attachment-info">
                    <a href="index.php?a=mail.file&mail_id=<?php echo $this->_tpl_vars['mail_id']; ?>
&fname=<?php echo $this->_tpl_vars['value']['fname']; ?>
" class="mailbox-attachment-name"><i class="fa fa-paperclip"></i> <?php echo $this->_tpl_vars['value']['fname']; ?>
</a>
                        <span class="mailbox-attachment-size">
                          <?php echo $this->_tpl_vars['value']['fsize']; ?>
 KB
                          <a href="index.php?a=mail.file&mail_id=<?php echo $this->_tpl_vars['mail_id']; ?>
&fname=<?php echo $this->_tpl_vars['value']['fname']; ?>
" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
                        </span>
                  </div>
                </li>
				<?php endforeach; endif; unset($_from); ?>
              </ul>
            </div>
			<?php else: ?>

              <div class="form-group" style="padding-left:10px;">
                <div class="btn btn-default btn-file">
                  <i class="fa fa-paperclip"></i> 附件
                  <input type="file" name="mail_file" >
                </div>
                <p class="help-block">最大不要超过32MB</p>
              </div>
			<?php endif; ?>

            <div class="box-footer">
              <div class="pull-right">
                  <input type="hidden" name="type" value="<?php echo $this->_tpl_vars['type']; ?>
">
			    <input type="hidden" name="MAX_FILE_SIZE" value="40960000">
                <button type="submit" class="btn btn-primary"><i class="fa fa-envelope-o"></i> 发送</button>
              </div>
              <button type="reset" class="btn btn-default"><i class="fa fa-times"></i> 重置</button>
            </div>
            <!-- /.box-footer -->
          </div>
          <!-- /. box -->
    
        </div>
		</form>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<script src="static/js/icheck.min.js"></script><!--邮箱-->

<!--编辑器-->
<script type="text/javascript" src="static/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="static/xhe/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
	$('#mail_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
}
function submitForm(){$('#myform').submit();}<!-- Page Script -->
</script>
<script src="static/js/run_prettify.js"></script>
<script src="static/js/jquery.mockjax.js"></script>
<script src="static/js/bootstrap-typeahead.js"></script>
 <script>
		$(function() {
			function displayResult(item) {
				$("#staff_id").val(item.value);
				if(item.value > 0){
				//window.location.href="index.php?a=staff.subjectupdate&staff_id="+item.value;
				}
			}
			$('#staff_name').typeahead({
			 source: [
			<?php $_from = $this->_tpl_vars['staff_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
            { id: <?php echo $this->_tpl_vars['value']['staff_id']; ?>
, name: '<?php echo $this->_tpl_vars['value']['staff_name']; ?>
' },
			<?php endforeach; endif; unset($_from); ?>
        ],

				onSelect: displayResult,
			});
		  
		});
	</script>